<?php

namespace app\common\logic;

use app\common\model\Goods;
use app\common\resourceHandle\GoodsResource;

class GoodsLogic extends BaseLogic
{
    public $model;

    public $resourceHandle;

    public function assignModel()
    {
        $this->model          = new Goods();
        $this->resourceHandle = new GoodsResource();
    }

    /**
     * 产品详情
     * @param array $params
     * @return array
     */
    public function info(array $params): array
    {
        $goods = $this->read($params['goods_id']);
        return $this->resourceHandle->handle($goods);
    }
}